﻿using System.Windows.Forms;
using Game;

namespace Memory.WindowsUI
{
    public class Program
    {
        public static void Main()
        {
            Application.EnableVisualStyles();

            FormGameSettings formGameSettings = new FormGameSettings();

            formGameSettings.ShowDialog();

            FormGameBoard newGameBoard;
            if (formGameSettings.DialogResult == DialogResult.OK)
            {
                newGameBoard = new FormGameBoard(formGameSettings.GameSettings);
            }
            else 
            {
                newGameBoard = new FormGameBoard(initDefaultSettings());
            }

            newGameBoard.ShowDialog();
        }

        private static GameSettings initDefaultSettings()
        {
            GameSettings defaultSettings = new GameSettings();
            defaultSettings.Cols = 4;
            defaultSettings.Rows = 5;
            defaultSettings.IsSinglePlayer = true;
            defaultSettings.Player1Name = "Defalut Eddie";

            return defaultSettings;
        }
    }
}
